import request from '@/utils/request'

// 1. 获取权限列表
export const reqGetPermissionList = () => {
  return request.get('/sys/permission')
}

// 2. 新增权限
export function reqAddPermission(data) {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}

// 3. 更新权限
export function reqUpdatePermission(data) {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}

// 4. 删除权限
export function reqDelPermission(id) {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}

// 5. 获取权限详情
export function reqGetPermissionDetail(id) {
  return request({
    url: `/sys/permission/${id}`
  })
}
